<template>
  <el-button
    v-bind="$attrs"
    v-if="userInfoStore.buttons.some((btn) => permission.includes(btn))"
  >
    <slot />
  </el-button>
</template>

<script lang="ts">
export default {
  name: "PermissionButton",
};
</script>

<script lang="ts" setup>
import { useUserInfoStore } from "@/stores/userInfo";

defineProps<{
  permission: string[];
}>();

const userInfoStore = useUserInfoStore();
</script>

<style scoped></style>
